<div class="widget">
  <div class="box">
    <h3>WNYHSports Poll</h3>
    <div id="boxContent">
      <?php
				$sql = "SELECT * FROM `poll_questions` WHERE `is_active` = 'Y'";
				$q = db::Query($sql);
				$question = $q->fetch();
				?>
      <h4 style="margin-bottom:-10px;"><?php echo $question['question'] ?></h4>
      <br/>
      <form class="niceform" method="post">
        <?php
						$sql = "SELECT * FROM  `poll_options` WHERE `question_id` = :id";
						$q = db::Query($sql, array(':id'=>$question['question_id']));
						$row = $q->fetch();
						?>
        <?php if($row['option1'] != NULL){ ?>
        <input type="radio" name="answer" id="answer1" value="1"/>
        <label for="answer1" class="opt"> <?php echo $row['option1'] ?> </label>
        <br/>
        <?php } ?>
        <?php if($row['option2'] != NULL){ ?>
        <input type="radio" name="answer" id="answer2" value="2"/>
        <label for="answer2" class="opt"> <?php echo $row['option2'] ?> </label>
        <br/>
        <?php } ?>
        <?php if($row['option3'] != NULL){ ?>
        <input type="radio" name="answer" id="answer3" value="3"/>
        <label for="answer3" class="opt"> <?php echo $row['option3'] ?> </label>
        <br/>
        <?php } ?>
        <?php if($row['option4'] != NULL){ ?>
        <input type="radio" name="answer" id="answer4" value="4"/>
        <label for="answer4" class="opt"> <?php echo $row['option4'] ?> </label>
        <br/>
        <?php } ?>
        <input type="hidden" name="question_id" value="<?php echo $question['question_id'] ?>" />
        <center>
          <input type="submit" value="Submit Poll" id="submit" />
        </center>
      </form>
    </div>
  </div>
</div>
